﻿using UnityEngine;
using System.Collections;

public class MessageScript : MonoBehaviour {

	public string message;
	public GUIStyle styles;
	float timeToDisplayMessageFor;
	float messageTimer;
	// Use this for initialization
	void Start () {
	
	}
	public void DisplayInstructions(string inMessage, float time, GUIStyle inStyle)
	{
		timeToDisplayMessageFor = time;
		message = inMessage;
		styles = inStyle;
	}
	
	void OnGUI () {
		if (messageTimer < timeToDisplayMessageFor) {
						GUI.Label (new Rect ((int)(Screen.width / 5.0f), Screen.height / 4, Screen.width, Screen.height), message, styles);
				}

	}
	// Update is called once per frame
	public void Update () {
		messageTimer += Time.deltaTime;
	}
}
